﻿@using GTAuto.DAL.DAL
@using GTAuto.DAL.Entities
@model GTAuto.DAL.Entities.GTFirmAdress
@{
    ViewBag.Title = "AdressEdit";
    Layout = "~/Views/Shared/_Layout.cshtml";
    List<string> err = ViewBag.Errs;
     

    GTFirm gtFirm = DALFirms.Singleton.Get(Model.FirmId);


}
<h4 class="alert_info">
    @if (Model.Id > 0)
    {
        <div>
            Редактирование адреса фирмы "@gtFirm.Name"</div>
    }
    else
    {
  
        <div>
            Создание адреса фирмы "@gtFirm.Name"</div>
    }
</h4>
@using (Html.BeginForm("AdressEdit", "Firms", FormMethod.Post, new { @class = "jNice", enctype = "multipart/form-data" }))
{

    if (err != null && err.Count != 0)
    {

        foreach (var er in err)
        {

    <h4 class="alert_error">
        @er</h4>

        }
    }
    if (ViewBag.Succes != null)
    {
    <h4 class="alert_success">
        @ViewBag.Succes</h4>
    }

    @Html.Hidden("FirmId", Model.FirmId)
    @Html.Hidden("Id", Model.Id)
    
    <article class="module width_full">
        <header><h3>Данные о адресе</h3></header>
        <div class="module_content">
            <fieldset>
                <label>Адрес</label>
                <input type="text" id="Adress" name="Adress" value="@Model.Adress" />
            </fieldset>
            <fieldset>
                <label>Коментарии к адресу</label>
                <input type="text" id="Coment" name="Coment" value="@Model.Coment" />
            </fieldset>
           
           
            <fieldset>
                <label>Телефон</label>
                <input type="text" id="Phone" name="Phone" value="@Model.Phone" />
            </fieldset>
            
            
            <fieldset>
                <label>Skype</label>
                <input type="text" id="Skype" name="Skype" value="@Model.Skype" />
            </fieldset>
            
            
            <fieldset>
                <label>Рабочее время</label>
                <input type="text" id="WorkingTime" name="WorkingTime" value="@Model.WorkingTime" />
            </fieldset>
            
            <fieldset>
                <label>Карта гугл</label>
                <textarea rows="20" cols="1" name="GoogleMap" id="GoogleMap">@Model.GoogleMap</textarea>
            </fieldset>

            <div class="clear"></div>
        </div>
      <footer>
                 <div class="submit_link">
               
                     <input type="submit" value="Сохранить " class="alt_btn">
               
                 </div>
             </footer>
    </article>
    
    <div class="spacer">
    </div>
}
<!-- end of post new article -->
<div class="spacer">
</div>
